<%= form_for @user, html: {class: 'form-horizontal', role: 'form'} do |f| %>
    <%= render 'shared/error_messages', :object => @user %>

    <div class="form-group">
      <%= f.label "姓名", class: 'col-sm-3 control-label' %>
      <div class="col-sm-9">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-user"></span></div>
          <%= f.text_field :name, class: 'form-control', placeholder: "输入真实姓名" %>
        </div>
      </div>
    </div>

    <div class="form-group">
      <%= f.label "用户名", class: 'col-sm-3 control-label' %>
      <div class="col-sm-9">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></div>
          <%= f.email_field :email, class: 'form-control', placeholder: "输入有效的邮箱" %>
        </div>
      </div>
    </div>

    <div class="form-group">
      <%= f.label "专业", class: 'col-sm-3 control-label' %>
      <div class="col-sm-9">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-home"></span></div>
          <%= f.text_field :major, class: 'form-control', placeholder: "输入专业全称" %>
        </div>
      </div>
    </div>


    <div class="form-group">
      <%= f.label "培养单位", class: 'col-sm-3 control-label' %>
      <div class="col-sm-9">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-home"></span></div>
          <%= f.text_field :department, class: 'form-control', placeholder: "输入培养单位全称" %>
        </div>
      </div>
    </div>

    <div class="form-group">
      <%= f.label "密码", class: 'col-sm-3 control-label' %>
      <div class="col-sm-9">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
          <%= f.password_field :password, class: 'form-control', placeholder: "输入密码" %>
        </div>
      </div>
    </div>

    <div class="form-group">
      <%= f.label "确认密码", class: 'col-sm-3 control-label' %>
      <div class="col-sm-9">
        <div class="input-group">
          <div class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></div>
          <%= f.password_field :password_confirmation, class: 'form-control', placeholder: "再次输入密码" %>
        </div>
      </div>
    </div>

    <%= f.submit '注册', class: "btn btn-primary btn-block" %>
    <%= link_to '取消', root_path, :class => "btn btn-default btn-block" %>

<% end %>
